package com.graduation.dao;

import com.graduation.entity.Cart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CartDao {
    /*首先查询商品是否存在*/
    Cart queryIsExist(@Param("goodsId") String id,@Param("email") String email);
    /*存在即更新*/
    Integer updateCartById(@Param("goodsId") String id,@Param("num") Integer num,@Param("price") Double price);
    /*加入购物车*/
    Integer addGoodsToCart(Cart cart);
    /*查看购物车*/
    List<Cart> queryGoodsByEmail(String email);
    /*删除*/
    Integer deleteGoodsById(String id);
}
